import 'package:eh_mobile/common/utils/index.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

// 灯光控制页面房间tabbar按钮
class SmartTabItem extends StatefulWidget {
  const SmartTabItem(this.title, {super.key, required this.selected});
  final String title;
  final bool selected;
  @override
  State<StatefulWidget> createState() {
    return _SmartTabItemState();
  }
}

class _SmartTabItemState extends State<SmartTabItem> {
  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.only(left: 11, right: 11).r,
      height: 32.h,
      child: Row(
        children: [
          Container(
            width: 3.r,
            height: 8.h,
            decoration: BoxDecoration(
              color: widget.selected
                  ? const Color.fromRGBO(255, 255, 255, 0.25)
                  : const Color.fromRGBO(255, 218, 75, 1),
              borderRadius: const BorderRadius.all(Radius.circular(2)),
            ),
          ),
          6.sizedBoxWidth,
          Text(widget.title, style: 14.ts)
        ],
      ),
    ).border(borderColor: const Color.fromRGBO(222, 222, 222, 0.35));
  }
}
